#ifndef _EPD_SES_266_H_
#define _EPD_SES_266_H_

#include "common.h"
#include "Cat_Fonts.h"
#define EPD_PWR P0_0
#define BUSY    P1_3
#define RST     P2_0
#define DC      P1_2
#define CS      P0_1
#define CLK     P0_5
#define MOSI    P0_3
#define EPD_SCLK_L   CLK=0
#define EPD_SCLK_H   CLK=1
#define EPD_SDI_H    MOSI=1
#define EPD_SDI_L    MOSI=0
#define EPD_DC_H     DC=1
#define EPD_DC_L     DC=0
#define EPD_CS_L     CS=0      
#define EPD_CS_H     CS=1     
#define EPD_RST_L    RST=0  
#define EPD_RST_H    RST=1 
#define EPD_BUSY   (BUSY)

#define EPD_2IN66_WIDTH       152
#define EPD_2IN66_HEIGHT      296

#define NEW_RAM   (0x01)
#define OLD_RAM   (0x02)
void DelayMS(uint msec);
void SendByte_softSPI(uint8 sdbyte);
void EPD_2IN66_SendCommand(uint8 cmd);
void EPD_2IN66_SendData(uint8 data);
void EPD_2IN66_SendData_Multi(const uint8 *data, uint16 data_size);
void _writeDataPGM(const uint8 *data, uint16 n, uint16 fill_with_zeroes);
void EPD_2IN66_ReadBusy(void);
void EPD_2IN66_Reset(void);
void EPD_2IN66_TurnOnDisplay(void);
void EPD_2IN66_TurnOnDisplayEX(void);
void EPD_2IN66_Init(void);
void EPD_2IN66_Init_Partial(void);
void EPD_2IN66_Clear(void);
void EPD_2IN66_part_Display(const uint8 *Image, uint8_t isold);
void EPD_2IN66_Display(uint8 *Image);
void EPD_2IN66_Sleep(void);
void EPD_DrawFonts(uint16 x, uint8 y_x8, uint8 gap, const char *str, const epdFONT_ascii *ascii_font,
                   const epdFONT_utf8 *utf8_font,uint8 ramX);
void EPD_draw(uint16 x, uint8 y_x8, uint16 x_size, uint8 y_size_x8, const uint8 *dat,uint8 ramX);
void EPD_SendData_Multi(const uint8 *data, uint16 data_size,uint8 Inverse);
void Draw_Battery(uint16_t x, uint8_t y, uint16_t max_voltage, uint16_t min_voltage, uint16_t voltage);
#endif